package org.example.wework.exception;

import io.appium.java_client.AppiumDriver;
import io.appium.java_client.android.Activity;
import io.appium.java_client.android.AndroidDriver;
import org.example.wework.App;


public class JumpOutExceptionHandler extends ExceptionHandler{

    @Override
    public Boolean isHit(String pageSource) {
        return pageSource.contains("com.mumu.launcher");
    }

    @Override
    public void handle(AppiumDriver driver) {
        Activity activity = new Activity(App.appPackage, App.appActivity);
        activity.setStopApp(false);
        ((AndroidDriver)driver).startActivity(activity);
    }
}
